// 地址
let url = 'http://www.baidu.com/aa'
// 对象
const obj = {
    username: 'zs',
    password: 123456,
    gender: '男'
}
// 创建空数组
let arr = [];
// 遍历对象
for (const key in obj) {
    arr.push(`${key}=${obj[key]}`);
}
console.log(arr);
arr2 = arr.join('&');
console.log(arr2);
url = url + '?' + arr2;
console.log(url);